package org.example.aienglishapp_login.util.response;

import lombok.Getter;

/**
 * @author Asus
 */

@Getter
public enum ResultCode {
    /**
     * 成功SUCCESS
     * 未找到NOT_FOUND
     * 内部错误INTERNAL_ERROR
     */
    SUCCESS(true, 200, "操作成功"),
    NOT_FOUND(false, 404, "资源未找到"),
    INTERNAL_ERROR(false, 500, "内部服务器错误"),

    // 新增状态码
    BAD_REQUEST(false, 400, "请求无效"),
    UNAUTHORIZED(false, 401, "未经授权"),
    CONFLICT(false, 409, "资源冲突"),
    FORBIDDEN(false, 403, "禁止访问");

    private final Boolean success;
    private final int code;
    private final String message;

    ResultCode(Boolean success, int code, String message) {
        this.success = success;
        this.code = code;
        this.message = message;
    }

}